//
//  oldMessageListTableViewCell.m
//  laonianbang
//
//  Created by 勇拓 李 on 18/4/3.
//  Copyright © 2018年 zaiyou. All rights reserved.
//

#import "oldMessageListTableViewCell.h"
#import "UIImageView+oldImageView.h"

@interface oldMessageListTableViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *img_avatar;
@property (weak, nonatomic) IBOutlet UILabel *label_name;
@property (weak, nonatomic) IBOutlet UILabel *label_time;
@property (weak, nonatomic) IBOutlet UILabel *label_reply;

@end

@implementation oldMessageListTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    _img_avatar.layer.cornerRadius = 35/2;
}

- (void)setMessage:(oldMomentMessage *)message
{
    _message = message;
    [_img_avatar showHeadImg:message.avatar];
    _label_name.text = message.uname;
    _label_time.text = message.created_at;
    switch ([message.type integerValue]) {
        case MomentMessageComment:
            _label_reply.text = message.content;
            break;
        case MomentMessageThumb:
            _label_reply.text = @"赞了你的说说";
            break;
        default:
            _label_reply.text = [NSString stringWithFormat:@"回复了你的评论：%@", message.content];
            break;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
